#include <QApplication>
#include "counter.h"
#include "reporter.h"

int main(int c, char **v)
{
    QApplication app(c, v);

    Counter a(5),b(10);
    Reporter r;

    a.setObjectName("Object a");
    b.setObjectName("Object b");

    a.setValue(40);

    QObject::connect(
            &a, SIGNAL(valueChanged(int,int,QString)),
            &b, SLOT(setValue(int))
            );

    QObject::connect(
            &a, SIGNAL(valueChanged(int,int,QString)),
            &r, SLOT(reportEvent(int,int,QString))
            );

    QObject::connect(
            &b, SIGNAL(valueChanged(int,int,QString)),
            &r, SLOT(reportEvent(int,int,QString))
            );

    a.setValue(33);

    return app.exec();
}

